package com.ubtechinc.cruzr.libai.honglauncher;

import android.app.Application;
import android.content.Context;

import com.blankj.utilcode.util.Utils;
import com.orhanobut.logger.AndroidLogAdapter;
import com.orhanobut.logger.Logger;
import com.ubtechinc.cruzr.libai.honglauncher.db.AppDatabase;


public class App extends Application {
    public static final int APP_ID = 1302;
    private static Context context;
    private static AppExecutors appExecutors;

    @Override
    public void onCreate() {
        super.onCreate();
        context = this;
        TtsManager.get().init();
        Utils.init(this);
        Logger.addLogAdapter(new AndroidLogAdapter());
        appExecutors = new AppExecutors();
    }

    public static Context getContext() {
        return context;
    }

    /**
     * 获得Room数据库操作
     *
     * @return database
     */
    public static AppDatabase getDatabase() {
        return AppDatabase.getInstance(getContext());
    }

    /**
     * 获取线程池
     *
     * @return 返回线程池
     */
    public static AppExecutors getAppExecutors() {
        return appExecutors;
    }

}
